use std::collections::HashMap;
fn main() {
    /*
    let c;
    //let mut c;
    static a:i32=3;
    c=2;
    */
//    const b:i32=5;
//    println!("Hello, world!");
 //   println!("{}",b);
//    Sum(1,2);
   // let mut c;
    //println!("{}",plus_one(3));
    /*
    let mut a=[1,2,3];
    let c:[i32;3]=[1,2,3];
    println!("{:?}",a);
    */
    /*
    let a=(1,2,3);
    println!("{:?}",a);
    let s="hello".to_string();
    */
    /*
    let a=11;
    let b=(a as f64)/2.0;
    println!("{}",b);
    */
//   let a=1;
    /*
    if a==1{
        println!("hello");
    }
        else{
            println!("world");
        }
        */
    /*
    let b =match a{
        1=>"a",
        _=>"null",
    };
    
    println!("{}",b);
    */
    /*
    let mut a=5;
    while a>0{
        println!("hello");
        a-=1;
    }
    */
    /*
    let mut  a=0;
    loop{
        if a==0{
            println!("value {}",a);
            a+=1;
            continue;
        }else if a==2{
            println!("value {}",a);
            break;
        }
        println!("value {}",a);
            a+=1;
    }
    */
    /*
    for a in 0..10{
        println!("hello");
    }
    */
    /*
let mybook=Book{
    title:String::from("libai"),
    price:i32::from(12),

};
println!("{}",mybook.title);
*/
struct Color(i32,i32,i32);
//let black=Color(0,0,0);
//println!("{}",black);
/*enum ip{
    v4(i32,i32,i32),
}
let myip=ip::v4(1,2,3);

let rect1=Rectangle{wid:12,len:2};
let rect2=Rectangle::square(10);
rect1.summarize();
println!("{}",rect2.area());
*/
/*
let integer=Point{x:3,y:2};
let float=Point{x:3.1,y:2.1};
//println!("{}",integer.x);
let v1=vec![1,2,3];
let v2:Vec<i32>=Vec::new();
//println!("{}",v1[2]);
let mut scores=HashMap::new();
scores.insert(String::from("blue"),10);
panic!("crash and burn");
*/
let x=1;
let y=3;
println!("{}",plus(x,y));
}
#[test]
fn it_works(){
    assert_eq!(4,plus(2,2),);
}
fn plus(x:i32,y:i32)->i32{
    x+y
}
struct Rectangle{
    len:i32,
    wid:i32,
}
impl Rectangle{
    fn area(&self)->i32{
        self.wid*self.len
    }
}
impl Rectangle{
    fn square(size:i32)->Rectangle{
        Rectangle{len:size,wid:size}
    }
}
trait Summary{
    fn summarize(&self)->String;
}
impl Summary for Rectangle{
    fn summarize(&self)->String{
        format!("{},{}",self.wid,self.len)
    }
}
struct Point<T>{
    x:T,
    y:T,
}

//println!("{}",mybook.title);
struct Book{
        title:String,
        price:i32,
    }
fn plus_one(a:i32)->i32{
    a+1
}
fn Sum(a:i8,b:i8){
    println!("sum is{}",a+b);
}
